package com.longjianghuasheng.logistics.business.order.adapter

import android.content.Context
import android.view.View
import android.widget.Button
import com.longjianghuasheng.logistics.R
import com.xuexiang.xui.widget.flowlayout.BaseTagAdapter

class FlowTagOrderDetailAdapter (context: Context?) : BaseTagAdapter<String, Button>(context) {

    var onClickListener: (String) -> Unit = {}
    override fun newViewHolder(convertView: View?): Button =
        convertView?.findViewById(R.id.btn_order)!!

    override fun getLayoutId(): Int = R.layout.order_detail_btn

    override fun convert(holder: Button?, item: String?, position: Int) {
        holder?.text = item

        holder?.setOnClickListener {

            onClickListener.invoke(item ?: "")

        }
    }

}